
<!--
  Preview this file by prepending http://htmlpreview.github.io/? to its URL
  e.g. http://htmlpreview.github.io/?https://raw.githubusercontent.com/Azure/bicep/main/src/textmate/test/baselines/functions.html
-->
<html>
  <head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/default.min.css">
  </head>
  <body>
    <pre class="hljs">
<span class="hljs-keyword">func</span> <span class="hljs-function">buildUrl</span>(<span class="hljs-variable">https</span> <span class="hljs-variable">bool</span>, <span class="hljs-variable">hostname</span> <span class="hljs-variable">string</span>, <span class="hljs-variable">path</span> <span class="hljs-variable">string</span>) <span class="hljs-variable">string</span> =&gt; <span class="hljs-string">&#39;</span><span class="hljs-subst">${</span><span class="hljs-variable">https</span><span class="hljs-string"> ? </span><span class="hljs-string">&#39;</span><span class="hljs-string">https</span><span class="hljs-string">&#39;</span><span class="hljs-string"> : </span><span class="hljs-string">&#39;</span><span class="hljs-string">http</span><span class="hljs-string">&#39;</span><span class="hljs-subst">}</span><span class="hljs-string">://</span><span class="hljs-subst">${</span><span class="hljs-variable">hostname</span><span class="hljs-subst">}</span><span class="hljs-subst">${</span><span class="hljs-function">empty</span><span class="hljs-string">(</span><span class="hljs-variable">path</span><span class="hljs-string">)</span><span class="hljs-string"> ? </span><span class="hljs-string">&#39;</span><span class="hljs-string">&#39;</span><span class="hljs-string"> : </span><span class="hljs-string">&#39;</span><span class="hljs-string">/</span><span class="hljs-subst">${</span><span class="hljs-variable">path</span><span class="hljs-subst">}</span><span class="hljs-string">&#39;</span><span class="hljs-subst">}</span><span class="hljs-string">&#39;</span>

<span class="hljs-keyword">output</span> <span class="hljs-variable">foo</span> <span class="hljs-variable">string</span> = <span class="hljs-function">buildUrl</span>(<span class="hljs-literal">true</span>, <span class="hljs-string">&#39;</span><span class="hljs-string">google.com</span><span class="hljs-string">&#39;</span>, <span class="hljs-string">&#39;</span><span class="hljs-string">search</span><span class="hljs-string">&#39;</span>)

<span class="hljs-keyword">func</span> <span class="hljs-function">sayHello</span>(<span class="hljs-variable">name</span> <span class="hljs-variable">string</span>) <span class="hljs-variable">string</span> =&gt; <span class="hljs-string">&#39;</span><span class="hljs-string">Hi </span><span class="hljs-subst">${</span><span class="hljs-variable">name</span><span class="hljs-subst">}</span><span class="hljs-string">!</span><span class="hljs-string">&#39;</span>

<span class="hljs-keyword">output</span> <span class="hljs-variable">hellos</span> <span class="hljs-variable">array</span> = <span class="hljs-function">map</span>([<span class="hljs-string">&#39;</span><span class="hljs-string">Evie</span><span class="hljs-string">&#39;</span>, <span class="hljs-string">&#39;</span><span class="hljs-string">Casper</span><span class="hljs-string">&#39;</span>], <span class="hljs-variable">name</span> =&gt; <span class="hljs-function">sayHello</span>(<span class="hljs-variable">name</span>))

<span class="hljs-keyword">func</span> <span class="hljs-function">objReturnType</span>(<span class="hljs-variable">name</span> <span class="hljs-variable">string</span>) <span class="hljs-variable">object</span> =&gt; {
  <span class="hljs-property">hello</span>: <span class="hljs-string">&#39;</span><span class="hljs-string">Hi </span><span class="hljs-subst">${</span><span class="hljs-variable">name</span><span class="hljs-subst">}</span><span class="hljs-string">!</span><span class="hljs-string">&#39;</span>
}

<span class="hljs-keyword">func</span> <span class="hljs-function">arrayReturnType</span>(<span class="hljs-variable">name</span> <span class="hljs-variable">string</span>) <span class="hljs-variable">array</span> =&gt; [
  <span class="hljs-variable">name</span>
]


    </pre>
  </body>
</html>